﻿using Microsoft.AspNetCore.Mvc;
using Spark.Core.Values;

namespace Spark.AspNetCore
{
    public class BaseApiController : ControllerBase
    {
        protected IActionResult Json<T>(T obj)
        {
            var response = new BaseResponse<T>
            {
                Data = obj,
                IsSuccess = true,
                Message = "操作成功！"
            };
            return Ok(response);
        }

        protected IActionResult Json()
        {
            var response = new BaseResponse
            {
                IsSuccess = true,
                Message = "操作成功！"
            };
            return Ok(response);
        }
    }
}